package reflect;

import java.lang.reflect.Constructor;

public class ReflectDemo3 {
    public static void main(String[] args) throws Exception {
        Person p=new Person("2王桑",250);
        System.out.println(p);

        Class cls=Class.forName("reflect.Person");

        Constructor c=cls.getConstructor(String.class,int.class);
        Object obj=c.newInstance("小王桑",290);
        System.out.println(obj);
    }
}
